<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><{$Think.config.cfg_webname}></title>
    <link href="__CSS__/base.css" rel="stylesheet">
    <link rel="stylesheet" href="__PUBLIC__/custom/uimaker/easyui.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/custom/uimaker/icon.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/fonts/iconfont.css">
    <script type="text/javascript" src="__PUBLIC__/custom/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/custom/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/custom/easyui-lang-zh_CN.js"></script>
    <style>
        #form {
            padding: 10px;
        }

        .formTable td {
            border-bottom: 1px dashed #efefef;
            height: 40px;
        }

        .td-left {
            text-align: right;
            padding-right: 10px;
        }

        .formTable .cnote {
            margin-left: 20px;
            color: #bfbfbf;
        }

        .formTable .trace {
            margin-left: 20px;
            color: red;
        }

        .logo_wrap {
            position: relative;
            width: 134px;
            height: 134px;
            margin: 5px;
        }

        .icon {
            width: 30px;
            height: 30px;
            font-size: 20px;
            vertical-align: middle;
            text-align: right;
            color: #333;
            -webkit-transition: font-size 0.25s ease-out 0s;
            -moz-transition: font-size 0.25s ease-out 0s;
            transition: font-size 0.25s ease-out 0s;
            position: absolute;
            right: -30px;
            top: 0px;
            cursor: pointer;
            font-weight: 700;
        }

        .icon:hover {
            font-size: 30px;
        }

        .picarr {
            width: 643px;
            min-height: 100px;
            padding: 0 12px 8px;
            margin-bottom: 7px;
            border: 1px solid #ccc;
            _height: auto !important;
            _height: 100px;
        }

        .picarr legend {
            padding: 3px 8px;
            font-weight: bold;
            color: #666;
        }

        .picarr div {
            width: 190px;
            line-height: 76px;
            color: #999;
            margin: 0 auto;
        }

        .picarr div span {
            margin-left: 8px;
            font-weight: bold;
            color: #09f;
            cursor: pointer;
        }

        .picarr div strong {
            padding: 0 3px;
            color: #d30000;
        }

        .picarr ul li {
            float: left;
            width: 311px;
            padding: 0 0 8px 10px;
        }

        .picarr ul li input {
            height: 22px;
            line-height: 22px;
            text-indent: 3px;
            border: none;
            border-bottom: 1px solid #ccc;
            width: 80%;
            ! float: left !important;
            _float: left;
            font-size: 12px;
        }

        .picarr ul li a {
            margin-left: 15px;
            color: #09F;
        }

        .picarr ul li span {
            margin-left: 15px;
        }

    </style>
</head>
<body>
<div class="easyui-panel" title="添加列表信息" style="width:100%;" data-options="footer:'#add_ft',fit:true">
    <form name="form" id="form" method="post" action="">
        <input type="hidden" value="" name="id"/>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="formTable">

            <tr>
                <td class="td-left">所属栏目：</td>
                <td>
                    <select class="easyui-combotree" url="<{:U('Info/getClassLevel')}>" name="classid"
                            style="height:30px;width:200px;"/>
                    <span class="cnote">单选</span>
                </td>
            </tr>
            <tr>
                <td class="td-left">文章标题：</td>
                <td>
                    <input name="title" type="text" class="easyui-textbox" data-options="required:true,"
                           style="height:30px;width:300px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">属性：</td>
                <td>
                    <{$html}>
                </td>
            </tr>
            <tr>
                <td class="td-left">文章来源：</td>
                <td>
                    <input name="source" type="text" class="easyui-textbox" data-options=""
                           style="height:30px;width:300px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">作者编辑：</td>
                <td>
                    <input name="author" type="text" class="easyui-textbox" data-options=""
                           style="height:30px;width:300px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">缩略图片：</td>
                <td>
                    <input type="text" name="picurl" id="picurl" class="input" style="height:30px; width:300px;"
                           value="<?php echo $picurl; ?>"/>
                    <span class="cnote"><span class="grayBtn"
                                              onclick="GetUploadify('uploadify2','缩略图上传','image','image',1,2097152,'picurl')">上 传</span></span>
                </td>
            </tr>
            <tr>
                <td class="td-left">跳转链接：</td>
                <td>
                    <input name="linkurl" type="text" class="easyui-textbox" data-options=""
                           style="height:30px;width:300px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">关键词：</td>
                <td>
                    <input name="keywords" type="text" class="easyui-textbox" data-options=""
                           style="height:30px;width:300px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">摘要：</td>
                <td><input name="description" class="easyui-textbox" type="text" data-options="multiline:true"
                           style="height:100px; width:500px;"/>
                </td>
            </tr>
            <tr>
                <td style="height:5px"></td>
            </tr>
            <tr>
                <td class="td-left">详细内容：</td>
                <td><input name="content" class="easyui-textbox" type="text" data-options="multiline:true"
                           style="height:300px; width:500px;"/></td>
            </tr>
            <tr>
                <td class="td-left">组图：</td>
                <td>
                    <!-- <input name="picarr" class="easyui-textbox" type="text" data-options="" style="height:30px; width:200px;"> -->
                    <fieldset class="picarr">
                        <legend>列表</legend>
                        <div>最多可以上传<strong>50</strong>张图片<span
                                onclick="GetUploadify('uploadify2','组图上传','image','image',50,2097152,'picarr','picarr_area')">开始上传</span>
                        </div>
                        <ul id="picarr_area">
                            <if condition="isset($picarr) && is_array($picarr)">
                                <ul id="picarr_area">
                                    <volist name="picarr" id="vo">
                                        <li rel="<{$vo[0]}>"><input type="text" name="picarr[]" value="<{$vo[0]}>"><a
                                                href="javascript:void(0);"
                                                onclick="ClearPicArr('<{$vo[0]}>')">删除</a><br/><input type="text"
                                                                                                      name="picarr_txt[]"
                                                                                                      value="<{$vo[1]}>"><span>描述</span>
                                            <img src = "/<{$vo[0]}>" style = "width:100px; height:100px">
                                        </li>
                                    </volist>
                                </ul>
                            </if>
                        </ul>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td class="td-left">点击次数：</td>
                <td>
                    <input name="hits" type="text" class="easyui-numberspinner"
                           data-options="min:1,increment:1,required:true" style="height:30px;width:200px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">排列排序：</td>
                <td>
                    <input name="orderid" type="text" class="easyui-numberspinner"
                           data-options="min:1,increment:1,required:true" style="height:30px;width:200px;"/>
                </td>
            </tr>
            <tr>
                <td class="td-left">更新时间：</td>
                <td><input class="easyui-datetimebox" name="birthday"
                           data-options="required:true,showSeconds:true" value="<{$time}>" style="width:200px"></td>
            </tr>
            <tr>
                <td class="td-left">审核：</td>
                <td>
                    <input type="radio" class="type" name="checkinfo" value="1" checked> 是
                    <input type="radio" class="type" name="checkinfo" value="2"> 否
                </td>
            </tr>

        </table>
        <div id="add_ft" style="padding:5px; text-align:center;">
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
               onclick="submitForm()">提交</a>
        </div>
    </form>
</div>
<script type="text/javascript" src="__JS__/getuploadify.js"></script>
<script type="text/javascript">
    //全局变量
    var GV = {
        ROOT: "__ROOT__/",
        WEB_ROOT: "__WEB_ROOT__/",
        MODULE: "__MODULE__",
        APP: '<{$Think.CONTROLLER_NAME }>'/*当前应用名*/
    };

    $(function(){
        <if condition="!empty($id)">
            $('#form').form('load','<{:U('Info/getInfoListDetail')}>/id/<{$id}>');
        </if>
        });



    function submitForm() {
        $('#form').form('submit', {
            url: '<{:U("Info/doAddInfoList")}>/id/<{$id}>',
            onSubmit: function () {
                return $(this).form('validate');
            },
            success: function (result) {
                var result = eval('(' + result + ')');
                console.log(result);
                if (result.success) {
                    <if condition="empty($id)">
                        $.messager.confirm('提示', '添加成功，继续添加?', function(r){
                        if (r){
                        $('#form').form('clear');
                        $("#picarr_area").empty();
                    }else{
                        goBack();
                    }
                    });
                        <else />
                        $.messager.alert('提示','修改成功!','info',function(){
                        goBack()
                    });
                    </if>
                } else {
                    $.messager.show({
                        title: '错误提示',
                        msg: result.msg
                    });
                }
            }
        });
    }


</script>


</body>
</html>
